#ifndef DSPSIMULATOR_REGISTERMAP_H
#define DSPSIMULATOR_REGISTERMAP_H

#include <unordered_map>
#include <string>
#include <memory>
#include <simulator/targetMachine/register.h>
#include <simulator/type/type.h>

class RegisterMap {
protected:
    std::unordered_map<std::string, std::shared_ptr<Register<u16>>> m_reg16Map;
    std::unordered_map<std::string, std::shared_ptr<Register<u32>>> m_reg32Map;
    std::unordered_map<std::string, std::shared_ptr<Register<u64>>> m_reg64Map;
public:
    RegisterMap() = default;

    ~RegisterMap() = default;

    RegisterMap(const RegisterMap &registerMap);

    bool addRegister16(std::shared_ptr<Register<u16>> reg);

    bool addRegister32(std::shared_ptr<Register<u32>> reg);

    bool addRegister64(std::shared_ptr<Register<u64>> reg);

    std::shared_ptr<Register<u16>> getReg16ByName(const std::string &regName);

    std::shared_ptr<Register<u32>> getReg32ByName(const std::string &regName);

    std::shared_ptr<Register<u64>> getReg64ByName(const std::string &regName);
};


#endif //DSPSIMULATOR_REGISTERMAP_H
